Repository navigation
fix(repo-universe): validate issue fields in check_issues (#6757) - #6761
Merged
Merged
Conversation
normalize_issue projected fields without validating them: a fieldless fetched issue became a phantom None state entry, a string number crashed sorted() and the whole run, and a field-missing persisted entry passed _valid_prior_entry and re-crashed daily. Add a shared _issue_field_error rule (number is a non-bool int; state/title/updated_at/html_url are strings; persisted key must equal str(number)) used by both normalize_issue (raises FetchError, per-repo ERROR) and _valid_prior_entry (malformed-state per-repo error). Regression tests cover fixture {}, string number alongside int, wrong-typed fields, and persisted {} — all fail on the old code, 19/19 pass after.
developing-today
Bot
requested review from
a team and
dezren39
as code owners
November 7, 2026 04:10
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
5 tasks
Member
|
Merging per standing merge authority (lane code-d, fallback mode, resuming lane code-l's park):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6757.
What
check_issues.pywas hardened in #6652 at the entry level only. Field-level wrong shape inside an object entry still broke it:normalize_issue({})projected to all-Nonefields and persisted a phantom issue under the state key"None"(report line- new: #None None (None)).numberreachedsorted(...)in the report and crashed the whole run withTypeError— outside theFetchErrorhandler, so no report and no state write._valid_prior_entryaccepted a field-missing persisted entry ("2": {}), which then crasheddiff_repowithKeyError: 'state'on every daily run until hand-repaired.Fix
One shared field rule,
_issue_field_error(oracle: the GitHub issues API shape this checker consumes):numbermust be anint— not a bool, string, list, or float;state/title/updated_at/html_urlmust be strings.Used in both places:
normalize_issueraisesFetchError→ per-repo ERROR line, other repos still checked, that repo's state untouched; no phantom"None"/"[1]"state keys are possible._valid_prior_entryalso requires each persisted issue to pass the rule and its key to equalstr(number)→ handled as the malformed-state per-repo error repo-universe(check_issues): valid-JSON wrong-shape fetch/state entries crash the whole checker instead of a per-repo ERROR — poison state re-crashes daily #6652 established, never a traceback.Tests
Regression tests in
test_check_issues.py(all fail/error on the pre-fix code:FAILED (failures=2, errors=2); all pass after):{}→ fetch ERROR, no phantom, healthy repo still baselined;numberalongside an integer-numbered issue → fetch ERROR, prior state untouched, no crash;normalize_issuerejects bool/list/float numbers and non-string fields;{}→ malformed-state ERROR, entry preserved.Full suite on the laptop:
python3 scripts/fleet/repo-universe/test_check_issues.py— 19 tests, OK. Valid behaviour (baseline, deltas, failed-fetch preservation) unchanged.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.